/**
 * Projects.java
 *
 * Copyright (c) 2009 prjmanager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of prjmanager .
 **/

package ro.prjmanager.model;


import javax.persistence.*;

/**
 * This class from the domain model is mapping the table projects
 * @author Viorel Tacliciu
 * @version 0.0.1
 */

@Table(name="projects")
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class  Projects{

    //define attributes that maps all columns of the coresponding table
    //this attribute maps the primary key column ID
    private java.lang.Integer id;
    //this attribute maps an bidirectional association
    //it means that FK_PROJECT from table project_db is a foreign key to ID
    private java.util.List<ProjectDb> fkProjectProjectDb;
    //this attribute maps an bidirectional association
    //it means that FK_PROJECT from table project_layers is a foreign key to ID
    private java.util.List<ProjectLayers> fkProjectProjectLayers;
    //this attribute maps an bidirectional association
    //it means that FK_PROJECT from table user_svn_project is a foreign key to ID
    private java.util.List<UserSvnProject> fkProjectUserSvnProject;
    //this attribute maps the column NAME
    private  java.lang.String  name;
    //this attribute maps the column DESCRIPTION
    private  java.lang.String  description;
    //this attribute maps the column PACKAGE_BASE
    private  java.lang.String  packageBase;

    private String companyName;

    private String shortName;

    //end mapping columns

    //define getters and setters with coresponding ejb3 annotation, depending of the type
    //of the relation for the column

    /**
     * Mapping the primary key
     * @return - java.lang.Integer the primary key for this entity
     **/
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID")
    public  java.lang.Integer  getId(){
        return this.id;
    }

    /**
     * The setter for ID column
     * @param id -  an java.lang.Integer object
     **/
    public void setId( java.lang.Integer  id){
        this.id=id;
    }
    /**
     * This method maps an OneToMany relation between this table and
     * ProjectDb table
     * @return - an list of ProjectDb objects
     **/
    @OneToMany(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_PROJECT",referencedColumnName = "ID") 
    public java.util.List<ProjectDb> getFkProjectProjectDb(){
        return this.fkProjectProjectDb;
    }
    
    /**
     * This method sets the field fkProjectProjectDb of this entity
     * @param fkProjectProjectDb - an list of ProjectDb objects
     **/
    public void setFkProjectProjectDb(java.util.List<ProjectDb> fkProjectProjectDb){
        this.fkProjectProjectDb=fkProjectProjectDb;
    }
    /**
     * This method maps an OneToMany relation between this table and
     * ProjectLayers table
     * @return - an list of ProjectLayers objects
     **/
    @OneToMany(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_PROJECT",referencedColumnName = "ID") 
    public java.util.List<ProjectLayers> getFkProjectProjectLayers(){
        return this.fkProjectProjectLayers;
    }
    
    /**
     * This method sets the field fkProjectProjectLayers of this entity
     * @param fkProjectProjectLayers - an list of ProjectLayers objects
     **/
    public void setFkProjectProjectLayers(java.util.List<ProjectLayers> fkProjectProjectLayers){
        this.fkProjectProjectLayers=fkProjectProjectLayers;
    }
    /**
     * This method maps an OneToMany relation between this table and
     * UserSvnProject table
     * @return - an list of UserSvnProject objects
     **/
    @OneToMany(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_PROJECT",referencedColumnName = "ID") 
    public java.util.List<UserSvnProject> getFkProjectUserSvnProject(){
        return this.fkProjectUserSvnProject;
    }
    
    /**
     * This method sets the field fkProjectUserSvnProject of this entity
     * @param fkProjectUserSvnProject - an list of UserSvnProject objects
     **/
    public void setFkProjectUserSvnProject(java.util.List<UserSvnProject> fkProjectUserSvnProject){
        this.fkProjectUserSvnProject=fkProjectUserSvnProject;
    }
    /**
     * This method gets the name attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "NAME")
    public  java.lang.String  getName(){
        return this.name;
    }

    /**
     * The setter for NAME column
     * @param name -  an  java.lang.String  object
     **/
    public void setName( java.lang.String  name){
        this.name=name;
    }
    /**
     * This method gets the description attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "DESCRIPTION")
    public  java.lang.String  getDescription(){
        return this.description;
    }

    /**
     * The setter for DESCRIPTION column
     * @param description -  an  java.lang.String  object
     **/
    public void setDescription( java.lang.String  description){
        this.description=description;
    }
    /**
     * This method gets the packageBase attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "PACKAGE_BASE")
    public  java.lang.String  getPackageBase(){
        return this.packageBase;
    }

    /**
     * The setter for PACKAGE_BASE column
     * @param packageBase -  an  java.lang.String  object
     **/
    public void setPackageBase( java.lang.String  packageBase){
        this.packageBase=packageBase;
    }

    @Column(name="COMPANY_NAME")
    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    @Column(name="SHORT_NAME")
    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }
}



